using System;
using System.Collections.Generic;
using System.Text;
using Pitoshka.DB.MySql;
using System.Data;

namespace Pitoshka.DB.Test
{
	class Program
	{
		static void Main(string[] args)
		{
			MySqlEngine eng = new MySqlEngine(String.Format(
				"server={0};user id={1}; password={2}; database={3}; pooling=false",
				"127.0.0.1",
				"root",
				"elfxf",
				"kub"
				));
			
			/*
			for (int i = 0; i < 100; i++)
			{
				
				eng.ExecuteNonQuery("insert into users (Name) values ('User" + i + "')");
			}
			 * */

			eng.ExecuteNonQuery("insert into category (parentId, Name) values (?parent, ?name)", CommandType.Text,
				new DBParameter[]
				{
					new DBParameter("?parent", null),
					new DBParameter("?name", "test")
				}
				);




			DataTable dt = eng.ExecuteSelect("select * from category");
			foreach (DataRow dr in dt.Rows)
			{
				Console.WriteLine(dr["Name"]);
			}
			Console.ReadKey();

		}
	}
}
